<?php

require_once dirname(__FILE__) . '/../../Extension/Params.php';
require_once dirname(__FILE__) . '/TextValues.php';

class Rase_Extension_WowsdpParams extends Raws_Extension_Params
{
  
  // protected $_rootNamespace = 'raws';
  // protected $_rootElement = 'params';

    # child elements of the params element
    protected $_description = null;
    protected $_port = null;
    protected $_filename = null;
    protected $_wowapp = null;
    protected $_ip_address = null;

    protected $_id = null;
    protected $_status = null;
    protected $_media = null;
    protected $_stream_loc = null;
    
    protected $_stream_uri = null;
    protected $_master_uri = null;
    protected $_broadcast_domain = null;
    protected $_broadcast_ip = null;
    protected $_broadcast_backup_domain = null;
    protected $_broadcast_backup_ip = null;

    public function __construct($description = null, $filename = null, $port = null, $wowapp = null, $ip_address = null) 
    {
        parent::__construct();
        $this->setDescription($description);
        $this->setPort($port);
        $this->setFilename($filename);
        $this->setWowapp($wowapp);
        $this->setIpAddress($ip_address);
    }
    
    /**
     * Retrieves a DOMElement which corresponds to this element and all
     * child properties.  This is used to build an entry back into a DOM
     * and eventually XML text for application storage/persistence.
     *
     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
     * @return DOMElement The DOMElement representing this element and all
     *          child properties.
     */
    public function getDOM($doc = NULL, $majorVersion = 1, $minorVersion = NULL)
    {
        $element = parent::getDOM($doc);
        if ($this->_description !== null) {
            $element->appendChild($this->_description->getDOM($element->ownerDocument));
        }
        if ($this->_port !== null) {
            $element->appendChild($this->_port->getDOM($element->ownerDocument));
        }
        if ($this->_filename !== null) {
            $element->appendChild($this->_filename->getDOM($element->ownerDocument));
        }
        if ($this->_wowapp !== null) {
            $element->appendChild($this->_wowapp->getDOM($element->ownerDocument));
        }
        if ($this->_ip_address !== null) {
            $element->appendChild($this->_ip_address->getDOM($element->ownerDocument));
        }
        if ($this->_id !== null) {
            $element->appendChild($this->_id->getDOM($element->ownerDocument));
        }
        if ($this->_status !== null) {
            $element->appendChild($this->_status->getDOM($element->ownerDocument));
        }
        if ($this->_media !== null) {
            $element->appendChild($this->_media->getDOM($element->ownerDocument));
        }
        if ($this->_stream_loc !== null) {
            $element->appendChild($this->_stream_loc->getDOM($element->ownerDocument));
        }
        if ($this->_stream_uri !== null) {
            $element->appendChild($this->_stream_uri->getDOM($element->ownerDocument));
        }
        if ($this->_master_uri !== null) {
            $element->appendChild($this->_master_uri->getDOM($element->ownerDocument));
        }
        if ($this->_broadcast_domain !== null) {
            $element->appendChild($this->_broadcast_domain->getDOM($element->ownerDocument));
        }
        if ($this->_broadcast_ip !== null) {
            $element->appendChild($this->_broadcast_ip->getDOM($element->ownerDocument));
        }
        if ($this->_broadcast_backup_domain !== null) {
            $element->appendChild($this->_broadcast_backup_domain->getDOM($element->ownerDocument));
        }
        if ($this->_broadcast_backup_ip !== null) {
            $element->appendChild($this->_broadcast_backup_ip->getDOM($element->ownerDocument));
        }
        
        return $element;
    }

    /**
     * Creates individual Entry objects of the appropriate type and
     * stores them as members of this entry based upon DOM data.
     *
     * @param DOMNode $child The DOMNode to process
     */
    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        
        switch ($absoluteNodeName) {
            case $this->lookupNamespace('raws') . ':' . 'description'; 
                $description = new Rase_Extension_Description();
                $description->transferFromDOM($child);
                $this->_description = $description;
                break;
            case $this->lookupNamespace('raws') . ':' . 'port'; 
                $port = new Rase_Extension_Port();
                $port->transferFromDOM($child);
                $this->_port = $port;
                break;
            case $this->lookupNamespace('raws') . ':' . 'filename'; 
                $filename = new Rase_Extension_Filename();
                $filename->transferFromDOM($child);
                $this->_filename = $filename;
                break;
            case $this->lookupNamespace('raws') . ':' . 'wowapp'; 
                $wowapp = new Rase_Extension_Wowapp();
                $wowapp->transferFromDOM($child);
                $this->_wowapp = $wowapp;
                break;
            case $this->lookupNamespace('raws') . ':' . 'ip_address'; 
                $ip_address = new Rase_Extension_IpAddress();
                $ip_address->transferFromDOM($child);
                $this->_ip_address = $ip_address;
                break;
            case $this->lookupNamespace('raws') . ':' . 'id'; 
                $id = new Rase_Extension_Id();
                $id->transferFromDOM($child);
                $this->_id = $id;
                break;
            case $this->lookupNamespace('raws') . ':' . 'status'; 
                $status = new Rase_Extension_Status();
                $status->transferFromDOM($child);
                $this->_status = $status;
                break;
            case $this->lookupNamespace('raws') . ':' . 'media'; 
                $media = new Rase_Extension_Media();
                $media->transferFromDOM($child);
                $this->_media = $media;
                break;
            case $this->lookupNamespace('raws') . ':' . 'stream_loc'; 
                $stream_loc = new Rase_Extension_StreamLoc();
                $stream_loc->transferFromDOM($child);
                $this->_stream_loc = $stream_loc;
                break;
            case $this->lookupNamespace('raws') . ':' . 'stream_uri'; 
                $stream_uri = new Rase_Extension_StreamUri();
                $stream_uri->transferFromDOM($child);
                $this->_stream_uri = $stream_uri;
                break;
            case $this->lookupNamespace('raws') . ':' . 'master_uri'; 
                $master_uri = new Rase_Extension_MasterUri();
                $master_uri->transferFromDOM($child);
                $this->_master_uri = $master_uri;
                break;
            case $this->lookupNamespace('raws') . ':' . 'broadcast_domain'; 
                $broadcast_domain = new Rase_Extension_BroadcastDomain();
                $broadcast_domain->transferFromDOM($child);
                $this->_broadcast_domain = $broadcast_domain;
                break;
            case $this->lookupNamespace('raws') . ':' . 'broadcast_ip'; 
                $broadcast_ip = new Rase_Extension_BroadcastIp();
                $broadcast_ip->transferFromDOM($child);
                $this->_broadcast_ip = $broadcast_ip;
                break;
            case $this->lookupNamespace('raws') . ':' . 'broadcast_backup_domain'; 
                $broadcast_backup_domain = new Rase_Extension_BroadcastBackupDomain();
                $broadcast_backup_domain->transferFromDOM($child);
                $this->_broadcast_backup_domain = $broadcast_backup_domain;
                break;
            case $this->lookupNamespace('raws') . ':' . 'broadcast_backup_ip'; 
                $broadcast_backup_ip = new Rase_Extension_BroadcastBackupIp();
                $broadcast_backup_ip->transferFromDOM($child);
                $this->_broadcast_backup_ip = $broadcast_backup_ip;
                break;
            default:
                parent::takeChildFromDOM($child);
                break;
        }
    }
    
    public function getDescription()
    {
        return $this->_description;
    }

    public function setDescription($value)
    {
        $this->_description = $value;
        return $this;
    }

    public function getPort()
    {
        return $this->_port;
    }

    public function setPort($value)
    {
        $this->_port = $value;
        return $this;
    }

    public function getFilename()
    {
        return $this->_filename;
    }

    public function setFilename($value)
    {
        $this->_filename = $value;
        return $this;
    }

    public function getWowapp()
    {
        return $this->_wowapp;
    }

    public function setWowapp($value)
    {
        $this->_wowapp = $value;
        return $this;
    }

    public function getIpAddress()
    {
        return $this->_ip_address;
    }

    public function setIpAddress($value)
    {
        $this->_ip_address = $value;
        return $this;
    }

    public function getId()
    {
        return $this->_id;
    }

    public function setId($value)
    {
        $this->_id = $value;
        return $this;
    }

    public function getStatus()
    {
        return $this->_status;
    }

    public function setStatus($value)
    {
        $this->_status = $value;
        return $this;
    }

    public function getMedia()
    {
        return $this->_media;
    }

    public function setMedia($value)
    {
        $this->_media = $value;
        return $this;
    }

    public function getStreamLoc()
    {
        return $this->_stream_loc;
    }

    public function setStreamLoc($value)
    {
        $this->_stream_loc = $value;
        return $this;
    }

    public function getStreamUri()
    {
        return $this->_stream_uri;
    }

    public function setStreamUri($value)
    {
        $this->_stream_uri = $value;
        return $this;
    }

    public function getMasterUri()
    {
        return $this->_master_uri;
    }

    public function setMasterUri($value)
    {
        $this->_master_uri = $value;
        return $this;
    }

    public function getBroadcastDomain()
    {
        return $this->_broadcast_domain;
    }

    public function setBroadcastDomain($value)
    {
        $this->_broadcast_domain = $value;
        return $this;
    }

    public function getBroadcastIp()
    {
        return $this->_broadcast_ip;
    }

    public function setBroadcastIp($value)
    {
        $this->_broadcast_ip = $value;
        return $this;
    }

    public function getBroadcastBackupDomain()
    {
        return $this->_broadcast_backup_domain;
    }

    public function setBroadcastBackupDomain($value)
    {
        $this->_broadcast_backup_domain = $value;
        return $this;
    }

    public function getBroadcastBackupIp()
    {
        return $this->_broadcast_backup_ip;
    }

    public function setBroadcastBackupIp($value)
    {
        $this->_broadcast_backup_ip = $value;
        return $this;
    }

}
